package cnsukidayo.com.gitee;

import cnsukidayo.com.gitee.utils.Resources;
import com.google.gson.Gson;
import org.fisco.bcos.sdk.BcosSDK;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair;

public class BcosSDKTest5 {

    private Gson gson = new Gson();
    // 获取配置文件路径
    public final String configFile = Resources.getResource("config.toml");

    public void testClient() throws Exception {
        // 初始化BcosSDK
        BcosSDK bcosSDK = BcosSDK.build(configFile);
        Client client = bcosSDK.getClient(1);
        CryptoKeyPair keyPair = client.getCryptoSuite().getCryptoKeyPair();
        System.out.println(keyPair.getAddress());
    }

    public static void main(String[] args) throws Exception {
        BcosSDKTest5 bcosSDKTest5 = new BcosSDKTest5();
        bcosSDKTest5.testClient();
    }

}
